<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  // 策略模式 + 装饰器模式 
  const move = {
    x: function( value ){
      console.log(`x:${value}`)
    },
    y: function( value){
      console.log(`y:${value}`)
    }
  }
  const attack = {
    n: function( value ){
      console.log(`伤害:${value}`)
    },
    percent: function( value){
      console.log(`伤害:${value}%`)
    }
  }

  let skill = {
    name : 'ssr',
    q:function() {
      attack.n(5) + attack.percent(5)
    }
  }
  skill.q()
</script>
</html>